package com.hospital.service.project.model.param;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.service.project.entity.ProInfoBase;
import com.hospital.service.project.entity.help.ProInfoBaseHelp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import enhance.plus.util.MybatisPlusUtil;
import java.io.Serializable;
import java.util.Map;

/**
 * 实验项目基本表 新增参数
 *
 * @author xhl
 * @created 2020-10-10 13:58:34
 */
@Data
@ToString
@ApiModel(value="ProInfoBase[实验项目基本表]入参")
public class ProInfoBaseQueryForOneRowParam implements Serializable{

    /**
     * 项目检索编号
     */
    @ApiModelProperty(value = "项目检索编号", required = true , example = "")
    private String projectNumber;

    /**
     * 把非 null 的值 转换成一个 查询条件
     * @return
     */
    public QueryWrapper<ProInfoBase> convertParamToQueryWapper(){
        QueryWrapper<ProInfoBase> query = ProInfoBaseHelp.createQuery();
        Map<String, Object> result =  MybatisPlusUtil.convertParamToMap(this, ProInfoBase.class);
        query.allEq(result);
        return query;
    }
}
